#pragma once

#include "../umlmodel_global.h"

#include <memory>
#include <vector>

#include "ActivityEdge.h"

using std::make_shared;
using std::shared_ptr;
using std::vector;

namespace uml {
class Behavior;

/// <summary>
/// ObjectFlow
/// An ObjectFlow is an ActivityEdge that is traversed by object tokens that may
/// hold values. Object flows also support multicast/receive, token selection from
/// object nodes, and transformation of tokens.
/// </summary>
class UMLMODEL_EXPORT ObjectFlow : public ActivityEdge {

public: // Constructors and destructors
    explicit ObjectFlow(const QString& umlType="uml::ObjectFlow");

public: // JsonSerializable override
    void fromJson(const QJsonObject& json, QStringList& errorList) override;
    void toJson(QJsonObject& json) override;

public: // Properties
    /// <summary>
    /// isMulticast getter
    /// Indicates whether the objects in the ObjectFlow are passed by multicasting.
    /// </summary>
    bool isMulticast() const;

    /// <summary>
    /// isMulticast setter
    /// Indicates whether the objects in the ObjectFlow are passed by multicasting.
    /// </summary>
    void setIsMulticast(bool value);

    /// <summary>
    /// isMultireceive getter
    /// Indicates whether the objects in the ObjectFlow are gathered from respondents to
    /// multicasting.
    /// </summary>
    bool isMultireceive() const;

    /// <summary>
    /// isMultireceive setter
    /// Indicates whether the objects in the ObjectFlow are gathered from respondents to
    /// multicasting.
    /// </summary>
    void setIsMultireceive(bool value);

    /// <summary>
    /// selection getter
    /// A Behavior used to select tokens from a source ObjectNode.
    /// </summary>
    shared_ptr<Behavior> selection() const;

    /// <summary>
    /// selection setter
    /// A Behavior used to select tokens from a source ObjectNode.
    /// </summary>
    void setSelection(shared_ptr<Behavior> value);

    /// <summary>
    /// transformation getter
    /// A Behavior used to change or replace object tokens flowing along the ObjectFlow.
    /// </summary>
    shared_ptr<Behavior> transformation() const;

    /// <summary>
    /// transformation setter
    /// A Behavior used to change or replace object tokens flowing along the ObjectFlow.
    /// </summary>
    void setTransformation(shared_ptr<Behavior> value);

private: // Fields
    /// <summary>
    /// isMulticast
    /// Indicates whether the objects in the ObjectFlow are passed by multicasting.
    /// </summary>
    const static bool isMulticast_default_;
    bool isMulticast_= isMulticast_default_;

    /// <summary>
    /// isMultireceive
    /// Indicates whether the objects in the ObjectFlow are gathered from respondents to
    /// multicasting.
    /// </summary>
    const static bool isMultireceive_default_;
    bool isMultireceive_= isMultireceive_default_;

    /// <summary>
    /// selection
    /// A Behavior used to select tokens from a source ObjectNode.
    /// </summary>
    shared_ptr<Behavior> selection_;

    /// <summary>
    /// transformation
    /// A Behavior used to change or replace object tokens flowing along the ObjectFlow.
    /// </summary>
    shared_ptr<Behavior> transformation_;

};

} // namespace uml
